// 获取assets静态资源
const getAssetsFile = (url) => {
  return new URL(`../assets/img/${url}`, import.meta.url).href;
};
const getAssetsFile2 = (url) => {
  return new URL(`../assets/icon/${url}`, import.meta.url).href;
};
// 复制
const copyAnyThing = (url) => {
  uni.setClipboardData({
    data: url,
    success: function () {
      uni.showToast({
        title: "复制成功",
        duration: 2000,
      });
    },
    fail: function () {
      uni.showToast({
        title: "复制失败",
        icon: "error",
        duration: 2000,
      });
    },
  });
};
export default {
  getAssetsFile,
  getAssetsFile2,
  copyAnyThing,
};
